
typedef unsigned long      lzo_uint;
typedef long               lzo_int;

typedef unsigned long      lzo_uint32;
typedef long               lzo_int32;
	 
typedef unsigned int size_t;

int lzo1x_decompress ( const unsigned char * in , lzo_uint in_len,
					   unsigned char * out, lzo_uint * out_len,
					   void * wrkmem );

int lzo1x_decompress_safe ( const unsigned char * in , lzo_uint in_len,
						unsigned char * out, lzo_uint * out_len,
						void * wrkmem );


int unlzo(unsigned char *in, unsigned char *out, unsigned char *buf)

{
	lzo_uint outlen = 0;
	lzo_uint inlen = *(lzo_uint*)in;

	int res = lzo1x_decompress(in + 16, inlen, out, &outlen, 0);

	*(unsigned int *)buf = outlen;
	
	return res;
	
}
